define(['app'], function (app) {

    app.config(['$stateProvider', '$urlRouterProvider', '$locationProvider',
        function ($stateProvider, $urlRouterProvider, $locationProvider) {

            $urlRouterProvider.when('', '/login');
            $stateProvider
                .state("login", {
                    url: "/login",
                    templateUrl: 'login.html',
                    controller: 'LoginCtrl'
                })
                .state("home", {
                    url: "/home", abstract: true, templateUrl: 'home.html'

                })


                .state("home.task", {
                    url: "/task",
                    views: {
                        '': {
                            templateUrl: 'views/task/home.task.html',
                            controller: 'taskCtrl'
                        }, 'sidebar': {
                            templateUrl: 'views/common/sidebar.html'
                        },
                        'footer': {
                            templateUrl: 'views/common/footer.html'
                        }
                    }
                })

                .state("home.taskDetail", {
                    url: "/task/detail/{task_id:[0-9]{1,}}",
                    views: {
                        '': {
                            templateUrl: 'views/task/home.task.detail.html',
                            controller: 'taskDetailCtrl'
                        }, 'sidebar': {
                            templateUrl: 'views/common/sidebar.html'
                        },
                        'footer': {
                            templateUrl: 'views/common/footer.html'
                        }
                    }
                })

                .state("home.rPacket", {
                    url: "/rPacket",
                    views: {
                        '': {
                            templateUrl: 'views/rPacket/home.rPacket.html',
                            controller: 'rPacketCtrl'
                        }, 'sidebar': {
                            templateUrl: 'views/common/sidebar.html'
                        },
                        'footer': {
                            templateUrl: 'views/common/footer.html'
                        }
                    }
                })

                .state("home.taskRPacket", {
                    url: "/taskRPacket",
                    views: {
                        '': {
                            templateUrl: 'views/taskRPacket/home.taskRPacket.html',
                            controller: 'taskRPacketCtrl'
                        }, 'sidebar': {
                            templateUrl: 'views/common/sidebar.html'
                        },
                        'footer': {
                            templateUrl: 'views/common/footer.html'
                        }
                    }
                })

                .state("home.withdraw", {
                    url: "/withdraw",
                    views: {
                        '': {
                            templateUrl: 'views/withdraw/home.withdraw.html',
                            controller: 'withdrawCtrl'
                        }, 'sidebar': {
                            templateUrl: 'views/common/sidebar.html'
                        },
                        'footer': {
                            templateUrl: 'views/common/footer.html'
                        }
                    }
                })

                .state("home.productDetail", {
                    url: "/product/detail/{prod_id:[0-9]{1,4}}",
                    views: {
                        '': {
                            templateUrl: 'views/tplProduct/home.product.create.html',
                            controller: 'ProductDetailCtrl'
                        }, 'sidebar': {
                            templateUrl: 'views/common/sidebar.html'
                        },
                        'footer': {
                            templateUrl: 'views/common/footer.html'
                        }
                    }
                })




        }
    ]);
});
